package com.xhwl.logistics.converter.mapstruct.logistics;

import com.xhwl.logistics.entity.approval.ApprovalProcess;
import com.xhwl.logistics.logistics.request.ApprovalProcessParam;
import com.xhwl.logistics.vo.logistics.approval.ApprovalProcessVO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(componentModel = "spring")
public interface ApprovalProcessConverter {
    ApprovalProcessConverter INSTANCE = Mappers.getMapper(ApprovalProcessConverter.class);

    ApprovalProcess toPoConvert(ApprovalProcessParam source);

    ApprovalProcessVO toVoConvert(ApprovalProcess po);

    @IterableMapping(elementTargetType = ApprovalProcess.class)
    List<ApprovalProcess> toPoConvertList(List<ApprovalProcessVO> source);

    @IterableMapping(elementTargetType = ApprovalProcessVO.class)
    List<ApprovalProcessVO> toVoConvertList(List<ApprovalProcess> source);
}
